<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="./common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0033)http://xm.ganji.com/vip/index.php -->
<HTML>
	<HEAD>
		<META content="IE=7.0000" http-equiv="X-UA-Compatible">
		<TITLE>会员中心-修改密码-91拍手|清华二手网|清华二手市场|清华二手物品交易</TITLE>
		<META content="text/html; charset=utf-8" http-equiv=Content-Type>
		<LINK rel=stylesheet type=text/css href="css/vip.css">
		<META name=GENERATOR content="MSHTML 8.00.7601.17537">
		<link type="text/css" href="css/jquery-ui-1.8.14.custom.css" />
		<script src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
function validate() {
	var pwold=$.trim(jQuery("#password").val());
if(pwold=="")
		{
		jQuery("#tip_checkcode").html("<label><font color='red' size='0.8em'>初始密码未填写！</font></label>");
		flag=false;
		}
	else{
	jQuery.post("checkPasswordAction.action", {
			password :jQuery("#password").val()
		}, function(data) {
			if (data=="no") {
			jQuery("#tip_checkcode").html(
						"<label><font color='red' size='0.8em'>密码填写错误！</font></label>");
			flag = false;	
			}
			 else {
			// table1 = document.getElementById("username").value=data;	
			jQuery("#tip_checkcode").html(""); 
			 flag = true;
			}
		}, "json");
	}

}

function validateNew(){
	var pwcurrent=$.trim(jQuery("#current").val());
	var pwcurrent2=$.trim(jQuery("#current2").val());
	if(pwcurrent=="")
		{
		jQuery("#tip_checknewcode").html("<label><font color='red' size='0.8em'>请填写新密码！</font></label>");
		flag=false;
		}
	else if(pwcurrent.length<6||pwcurrent.length>16)
		{
		jQuery("#tip_checknewcode").html("<label><font color='red' size='0.8em'>密码长度为6-16位字符！</font></label>");
		}
		else
		{
		jQuery("#tip_checknewcode").html("");
		}
		
	if(pwcurrent!=pwcurrent2)
		{
		jQuery("#tip_checknewcode2").html("<label><font color='red' size='0.8em'>两次输入的密码不一致！</font></label>");
		flag=false;
		}
		else
		{
		jQuery("#tip_checknewcode2").html("");
		}
}

</script>
	</HEAD>
	<BODY>
		<DIV class=blueBar></DIV>
		<DIV class="globalContainer clearfix">
			<!--header-->
			<DIV class=head>
				<DIV class=headNav>
					<SPAN class="fr viptop"><A class=pub
						href="<s:url action="goChooseTypeAction"></s:url>" target=_blank>免费发帖</A>
						<A href="<s:url action="goVipAction"><s:param name="userId"> 
                       			 	<s:property value="user.id"/> 
                    			</s:param> 
</s:url>"><s:property
								value="user.username" />
					</A> <A href="<s:url action="logoutAction"></s:url>">退出帐户</A> </SPAN><SPAN class=where><A
						href="<s:url action="goVipAction"></s:url>">会员中心首页</A>
					</SPAN>
				</DIV>
				<H1 class=vipLogo>
					<A title=返回首页 href="index.jsp"></A>
				</H1>
			</DIV>
			<!--end-->
			<DIV class=mainContainer>
					<DIV class=rightCol>
						<DIV class=right_top>
							<SPAN class=button><A class=btn-b
								href="<s:url action="goEditUserinfoAction"><s:param name="userId"> 
                       			 	<s:property value="user.id"/> 
                    			</s:param> 
</s:url>">个人信息</A>
							</SPAN><SPAN class="button on"><A class=btn-b
								href="<s:url action="goEditPasswordAction"><s:param name="userId"> 
                       			 	<s:property value="user.id"/> 
                    			</s:param> 
</s:url>">修改密码</A>
							</SPAN>
						</DIV>
						<DIV>
							<DIV class=rightBody>
								<DIV class=user-info>
									<DL class="mt5 clearfix">
										<DT>
											<IMG class=photo alt=头像 src="image/normal-headphoto.png"
												width=120 height=120>
										</DT>
										<DD>
											<s:form action="updatePasswordAction" method="post"
												enctype="multipart/form-data" onsubmit="return check(this);">
												<s:hidden name="userinfo.id"></s:hidden>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="t-info mt5">
            <tr>
              <td>旧密码：</td>
            </tr>
             <tr>
              <td>
<s:password id="password" cssClass="input-text" size="50" name="original" onblur="validate()"/>
              <span id="tip_checkcode" style="float:left;width:136px"></span>
              </td>
            </tr>
            <tr>
              <td>新密码：</td>
            </tr>
            <tr>
              <td>
             <s:password id="current" cssClass="input-text" size="50" name="current" onblur="validateNew()"/>
              <span id="tip_checknewcode" style="float:left;width:136px"></span>
              </td>
            </tr>
            <tr>
              <td class="fc-aaa"> </td>
            </tr>
            <tr>
              <td>再输入新密码：</td>
            </tr>
            <tr>
              <td>
              <s:password id="current2" cssClass="input-text" size="50" name="current2" onblur="validateNew()"/>
              <span id="tip_checknewcode2" style="float:left;width:136px"></span>
              </td>
            </tr>
            <tr>
              <td>
                            </td>
            </tr>
            <tr>
              <td>
<s:submit cssClass="submit" id="submit" value="完成修改" />
</td>
              <td></td>
              <td>&nbsp;</td>
            </tr>
          </table>
											</s:form>

										</DD>
									</DL>
								</DIV>
							</DIV>
						</DIV>
					</DIV>
				<!--左侧菜单开始 -->
				<s:include value="include/loadingleftside.jsp"></s:include>
				<!--左侧菜单结束 -->
			</DIV>
			<!--底部开始 -->
			<s:include value="include/footer.jsp"></s:include>

			<!--底部结束 -->
		</DIV>
		</SPAN>
	</BODY>
</HTML>
